package com.liudadan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@Controller
@RequestMapping("header")
public class HeaderController {

    @GetMapping("data")
    public String data(@RequestHeader("user-agent") String userAgent){
        System.out.println("HeaderController.data");
        System.out.println("userAgent = " + userAgent);
        return userAgent;
    }
}
